package com.ibm.cps.newmessage;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ibm.cps.message.MessageFields;
import com.ibm.cps.newmessage.MetadataInputSchema.FieldType;
import com.ibm.interfaces.IMessageClient;
import com.ibm.util.JSONUtility;
import com.ibm.util.exception.CPSException;

public class MongoDataSourceMetaData extends AbstractDataSourceMetadata{

	private String mongo_static_url;
	
	public MongoDataSourceMetaData(String metadata) throws CPSException {
		this(JSONUtility.fromObjectString(metadata));
	}
	
	public MongoDataSourceMetaData(ObjectNode metadata) throws CPSException {
		super(metadata);
		this.mongo_static_url = JSONUtility.GetString(MessageFields.STATIC_MONGO_URL, metadata);
	}

	@Override
	public MetadataInputSchema getInputMetadataSchema() {
		MetadataInputSchema inputSchema = new MetadataInputSchema();
		inputSchema.addField(FieldType.String, MessageFields.STATIC_MONGO_URL);
		return inputSchema;
	}

	@Override
	public IMessageClient getDataSourceConsumerClient() throws CPSException {
		// unnecessary to implement
		return null;
	}

	@Override
	public String getSubscribeTarget() {
		// unnecessary to implement.
		return null;
	}


}
